package com.demo.no1springboot;

import com.demo.no1springboot.pojo.Users;
import com.demo.no1springboot.service.No1springbootService;
import com.demo.no1springboot.service.UsersService;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {No1springbootApplication.class})
class No1springbootApplicationTests {
    @Autowired
    UsersService usersService;
    @Autowired
    No1springbootService no1springbootService;
    @Test
    public void contextLoads() {
        System.out.println(no1springbootService.get());
    }
    @Test
    public void testAddUser(){
        Users users = new Users();
        users.setId(1);
        users.setNam("二狗");
        users.setPwd("111");
        users.setSex(1);
        users.setBirth(new Date());
        this.usersService.addUser(users);
    }
}
